//
//  AES+Base64ViewController.m
//  AES
//
//  Created by thinkjoy on 16/10/25.
//  Copyright © 2016年 Thinkjoy_RS. All rights reserved.
//

#import "AES+Base64ViewController.h"

#import "SecurityUtil.h"

@interface AES_Base64ViewController ()
@property (weak, nonatomic) IBOutlet UITextView *mainTextView;
- (IBAction)clickEncode:(id)sender;
- (IBAction)clickDecode:(id)sender;

@end

@implementation AES_Base64ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

- (IBAction)clickEncode:(id)sender
{
    self.mainTextView.text = [SecurityUtil encryptAESData:self.mainTextView.text];
}

- (IBAction)clickDecode:(id)sender
{
    self.mainTextView.text = [SecurityUtil decryptAESData:self.mainTextView.text];
}
@end
